import type { CategoryTopItem } from '@/types/category'
import type { PeiSongDian } from '@/types/address'
import { http } from '@/utils/http'

/**
 * 分类列表-小程序
 */
export const getCategoryTopAPI = () => {
  return http<CategoryTopItem[]>({
    method: 'GET',
    url: '/category/top',
  })
}

//计算配送点
export const getPeiSongDianAPI = (data: { latitude: number; longitude: number }) => {
  return http<PeiSongDian[]>({
    method: 'POST',
    url: '/system/distance',
    data,
  })
}

//获取餐品分类
export const getMealTypeAPI = () => {
  return http<CategoryTopItem[]>({
    method: 'GET',
    url: '/system/deadline',
  })
}
